package com.example.mylearn.proxy.dynamicProxy.cglib;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class MyMethodInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {

        System.out.println("调用前" + method.getName());
        Object invoke = proxy.invokeSuper(obj, args);
        System.out.println("调用后" + method.getName());
        return invoke;
    }
}
